package com.lemon.system.api.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lemon.common.core.annotation.Excel;
import com.lemon.common.core.base.BaseEntity;
import com.lemon.common.core.serializer.JsonLongDeserializer;
import com.lemon.common.core.serializer.JsonLongSerializer;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 包名称：com.lemon.system.domain
 * 类名称：BiUser
 * 类描述：普通用户表
 * 创建人：@author huangpeng
 * 创建时间：2023年01月07日 11:06
 */
public class BiUser extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 用户id */
    @JsonSerialize(using = JsonLongSerializer.class)
    @JsonDeserialize(using = JsonLongDeserializer.class)
    private Long id;

    /** 登录名 */
    @Excel(name = "登录名")
    private String userCode;

    /** 用户名 */
    @Excel(name = "用户名")
    private String userName;

    /** 密码 */
    private String password;

    /** 性别 */
    @Excel(name = "性别", dictType = "sys_user_sex")
    private Long gender;

    /** 头像 */
    @Excel(name = "头像")
    private String avatar;

    /** 昵称 */
    @Excel(name = "昵称")
    private String nickName;

    /** 生日 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
    private Date birthday;

    /** 邮箱 */
    @Excel(name = "邮箱")
    private String email;

    /** 电话 */
    @Excel(name = "电话")
    private String phone;

    /** QQ */
    @Excel(name = "QQ")
    private String qqNumber;

    /** 微信号 */
    @Excel(name = "微信号")
    private String weChat;

    /** 介绍 */
    @Excel(name = "介绍")
    private String summary;

    /** 签名 */
    @Excel(name = "签名")
    private String signature;

    /** 排序 */
    private Long orderNo;

    /** 用户类型 */
    @Excel(name = "用户类型", dictType = "sys_user_type")
    private String userType;

    /** 邮箱验证码 */
    private String validCode;

    /** 评论状态 */
    @Excel(name = "评论状态", dictType = "sys_normal_disable")
    private String commentStatus;

    /** ip来源 */
    private String ipSource;

    /** 浏览器 */
    private String browser;

    /** 操作系统 */
    private String oprationSystem;

    /** 邮件通知状态  */
    @Excel(name = "邮件通知状态 ", dictType = "sys_normal_disable")
    private String startEmailNotification;

    /** 是否通过加载校验【0 未通过，1 已通过】 */
    private String loadingValid;

    /** 资料来源 */
    @Excel(name = "资料来源", dictType = "sys_user_origin")
    private String dataOrigin;

    /** 资料来源平台的当前用户唯一uid */
    private String originUid;

    /** 职业 */
    @Excel(name = "职业")
    private String occupation;

    /** 启用状态 */
    @Excel(name = "启用状态", dictType = "sys_normal_disable")
    private String status;

    /** 密码错误次数 */
    @Excel(name = "密码错误次数")
    private Long loginErrorCount;

    /** 登录次数 */
    @Excel(name = "登录次数")
    private Long loginCount;

    /** 最后登录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastLoginTime;

    /** 最后登录IP */
    @Excel(name = "最后登录IP")
    private String lastLoginIp;

    /** 密码到期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "密码到期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expireTime;

    /**
     * 背景图片
     */
    private String backUrl;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setUserCode(String userCode)
    {
        this.userCode = userCode;
    }

    public String getUserCode()
    {
        return userCode;
    }
    public void setUserName(String userName)
    {
        this.userName = userName;
    }

    public String getUserName()
    {
        return userName;
    }
    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getPassword()
    {
        return password;
    }
    public void setGender(Long gender)
    {
        this.gender = gender;
    }

    public Long getGender()
    {
        return gender;
    }
    public void setAvatar(String avatar)
    {
        this.avatar = avatar;
    }

    public String getAvatar()
    {
        return avatar;
    }
    public void setNickName(String nickName)
    {
        this.nickName = nickName;
    }

    public String getNickName()
    {
        return nickName;
    }
    public void setBirthday(Date birthday)
    {
        this.birthday = birthday;
    }

    public Date getBirthday()
    {
        return birthday;
    }
    public void setEmail(String email)
    {
        this.email = email;
    }

    public String getEmail()
    {
        return email;
    }
    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    public String getPhone()
    {
        return phone;
    }
    public void setQqNumber(String qqNumber)
    {
        this.qqNumber = qqNumber;
    }

    public String getQqNumber()
    {
        return qqNumber;
    }
    public void setWeChat(String weChat)
    {
        this.weChat = weChat;
    }

    public String getWeChat()
    {
        return weChat;
    }
    public void setSummary(String summary)
    {
        this.summary = summary;
    }

    public String getSummary()
    {
        return summary;
    }
    public void setSignature(String signature)
    {
        this.signature = signature;
    }

    public String getSignature()
    {
        return signature;
    }
    public void setOrderNo(Long orderNo)
    {
        this.orderNo = orderNo;
    }

    public Long getOrderNo()
    {
        return orderNo;
    }
    public void setLoginErrorCount(Long loginErrorCount)
    {
        this.loginErrorCount = loginErrorCount;
    }

    public Long getLoginErrorCount()
    {
        return loginErrorCount;
    }
    public void setLoginCount(Long loginCount)
    {
        this.loginCount = loginCount;
    }

    public Long getLoginCount()
    {
        return loginCount;
    }
    public void setLastLoginTime(Date lastLoginTime)
    {
        this.lastLoginTime = lastLoginTime;
    }

    public Date getLastLoginTime()
    {
        return lastLoginTime;
    }
    public void setLastLoginIp(String lastLoginIp)
    {
        this.lastLoginIp = lastLoginIp;
    }

    public String getLastLoginIp()
    {
        return lastLoginIp;
    }
    public void setExpireTime(Date expireTime)
    {
        this.expireTime = expireTime;
    }

    public Date getExpireTime()
    {
        return expireTime;
    }
    public void setUserType(String userType)
    {
        this.userType = userType;
    }

    public String getUserType()
    {
        return userType;
    }
    public void setValidCode(String validCode)
    {
        this.validCode = validCode;
    }

    public String getValidCode()
    {
        return validCode;
    }
    public void setCommentStatus(String commentStatus)
    {
        this.commentStatus = commentStatus;
    }

    public String getCommentStatus()
    {
        return commentStatus;
    }
    public void setIpSource(String ipSource)
    {
        this.ipSource = ipSource;
    }

    public String getIpSource()
    {
        return ipSource;
    }
    public void setBrowser(String browser)
    {
        this.browser = browser;
    }

    public String getBrowser()
    {
        return browser;
    }
    public void setOprationSystem(String oprationSystem)
    {
        this.oprationSystem = oprationSystem;
    }

    public String getOprationSystem()
    {
        return oprationSystem;
    }
    public void setStartEmailNotification(String startEmailNotification)
    {
        this.startEmailNotification = startEmailNotification;
    }

    public String getStartEmailNotification()
    {
        return startEmailNotification;
    }
    public void setLoadingValid(String loadingValid)
    {
        this.loadingValid = loadingValid;
    }

    public String getLoadingValid()
    {
        return loadingValid;
    }
    public void setDataOrigin(String dataOrigin)
    {
        this.dataOrigin = dataOrigin;
    }

    public String getDataOrigin()
    {
        return dataOrigin;
    }
    public void setOriginUid(String originUid)
    {
        this.originUid = originUid;
    }

    public String getOriginUid()
    {
        return originUid;
    }
    public void setOccupation(String occupation)
    {
        this.occupation = occupation;
    }

    public String getOccupation()
    {
        return occupation;
    }
    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public String getBackUrl() {
        return backUrl;
    }

    public void setBackUrl(String backUrl) {
        this.backUrl = backUrl;
    }

    @Override
    public String toString() {
        return "BiUser{" +
                "id=" + id +
                ", userCode='" + userCode + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", gender=" + gender +
                ", avatar='" + avatar + '\'' +
                ", nickName='" + nickName + '\'' +
                ", birthday=" + birthday +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", qqNumber='" + qqNumber + '\'' +
                ", weChat='" + weChat + '\'' +
                ", summary='" + summary + '\'' +
                ", signature='" + signature + '\'' +
                ", orderNo=" + orderNo +
                ", userType='" + userType + '\'' +
                ", validCode='" + validCode + '\'' +
                ", commentStatus='" + commentStatus + '\'' +
                ", ipSource='" + ipSource + '\'' +
                ", browser='" + browser + '\'' +
                ", oprationSystem='" + oprationSystem + '\'' +
                ", startEmailNotification='" + startEmailNotification + '\'' +
                ", loadingValid='" + loadingValid + '\'' +
                ", dataOrigin='" + dataOrigin + '\'' +
                ", originUid='" + originUid + '\'' +
                ", occupation='" + occupation + '\'' +
                ", status='" + status + '\'' +
                ", loginErrorCount=" + loginErrorCount +
                ", loginCount=" + loginCount +
                ", lastLoginTime=" + lastLoginTime +
                ", lastLoginIp='" + lastLoginIp + '\'' +
                ", expireTime=" + expireTime +
                ", backUrl='" + backUrl + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BiUser biUser = (BiUser) o;
        return Objects.equals(id, biUser.id) && Objects.equals(userCode, biUser.userCode) && Objects.equals(userName, biUser.userName) && Objects.equals(password, biUser.password) && Objects.equals(gender, biUser.gender) && Objects.equals(avatar, biUser.avatar) && Objects.equals(nickName, biUser.nickName) && Objects.equals(birthday, biUser.birthday) && Objects.equals(email, biUser.email) && Objects.equals(phone, biUser.phone) && Objects.equals(qqNumber, biUser.qqNumber) && Objects.equals(weChat, biUser.weChat) && Objects.equals(summary, biUser.summary) && Objects.equals(signature, biUser.signature) && Objects.equals(orderNo, biUser.orderNo) && Objects.equals(userType, biUser.userType) && Objects.equals(validCode, biUser.validCode) && Objects.equals(commentStatus, biUser.commentStatus) && Objects.equals(ipSource, biUser.ipSource) && Objects.equals(browser, biUser.browser) && Objects.equals(oprationSystem, biUser.oprationSystem) && Objects.equals(startEmailNotification, biUser.startEmailNotification) && Objects.equals(loadingValid, biUser.loadingValid) && Objects.equals(dataOrigin, biUser.dataOrigin) && Objects.equals(originUid, biUser.originUid) && Objects.equals(occupation, biUser.occupation) && Objects.equals(status, biUser.status) && Objects.equals(loginErrorCount, biUser.loginErrorCount) && Objects.equals(loginCount, biUser.loginCount) && Objects.equals(lastLoginTime, biUser.lastLoginTime) && Objects.equals(lastLoginIp, biUser.lastLoginIp) && Objects.equals(expireTime, biUser.expireTime) && Objects.equals(backUrl, biUser.backUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userCode, userName, password, gender, avatar, nickName, birthday, email, phone, qqNumber, weChat, summary, signature, orderNo, userType, validCode, commentStatus, ipSource, browser, oprationSystem, startEmailNotification, loadingValid, dataOrigin, originUid, occupation, status, loginErrorCount, loginCount, lastLoginTime, lastLoginIp, expireTime, backUrl);
    }
}